# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

_realname=podman-compose
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.0.3
pkgrel=2
pkgdesc="Get and set values in your .env file in local and production servers (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/containers/podman-compose'
license=(GPL2)
depends=(
    "${MINGW_PACKAGE_PREFIX}-podman"
    "${MINGW_PACKAGE_PREFIX}-python-dotenv"
    "${MINGW_PACKAGE_PREFIX}-python-yaml"
)
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-python-build"
  "${MINGW_PACKAGE_PREFIX}-python-installer"
  "${MINGW_PACKAGE_PREFIX}-python-setuptools"
  "${MINGW_PACKAGE_PREFIX}-python-wheel"
)
options=("!strip")
source=("$_realname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('b28e5792a50feee987e7864e0df1b6e8929c923c010e1f65493fe29b4c2aedcf')

build() {
  cd "${_realname}-${pkgver}"

  ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${_realname}-${pkgver}"

  MSYS2_ARG_CONV_EXCL="--prefix=" \
    ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
    --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
